import axios from './axios'


// 查菜品信息
export function qryInfoMenu() {
  return axios({
    url: '/qryInfoMenu',
    method: 'post',
    data: {}
  })
}

// 按照菜名和种类搜索
export function qryMenuByName( keyword) {
  return axios({
    url: `/qryMenuByName/${keyword}`,
    method: 'get'
  })
}



//根据id查询信息
export function qryMenuInfoById(foodid) {
  return axios({
    url: '/qryMenuInfoById',
    method: 'post',
    data: {
      foodid: foodid
    }
  })
}

//点餐
export function clickById(foodid) {
  return axios({
    url: '/click',
    method: 'post',
    data: {
      foodid: foodid,
    }
  })
}

// 根据id修改信息
export function updateMenuInfoById(menu) {
  return axios({
    url: '/updateMenuInfoById',
    method: 'post',
    data: {
      foodid: menu.foodid,
      foodname: menu.foodname,
      price: menu.price,
      foodtype: menu.foodtype
    }
  })
}

// 根据id删除菜品
export function deleteMenuInfoById(foodid) {
  return axios({
    url: '/deleteMenuInfoById',
    method: 'post',
    data: {
      foodid: foodid,
    }
  })
}
